<template>
  <div>
    <micro-app v-if="url" :name='name' :url='url' :baseroute='route'></micro-app>
  </div>
</template>

<script>

import microApp from '@micro-zoe/micro-app'
import {uuid} from 'vue-uuid'

export default {
  name: "MicroAppFrame",
  props: {
    params: {
      type: Object,
      required: true
    },
  },
  data() {
    return {
      name: null,
      url: null,
      route: null
    };
  },
  created() {
    this.init()
  },
  methods: {
    init() {
      this.name = "microApp_" + uuid.v1()
      this.url = this.params.microAppUrl
      this.route = this.params.microAppRoute || ''
    },
  }
};
</script>
